<template>
  <header class="category-header wrap">
    <i class="iconfont iconfont-xiangzuo" @click="$router.go(-1)"></i>
    <div class="header-search">
      <i class="iconfont iconfont-wxbsousuotuiguang"></i>
      <input type="text" class="search-title" :value="searchText" @input="sendText" />
    </div>
    <i class="iconfont iconfont-gengduo-hengxiang"></i>
  </header>
</template>

<script>

export default {
  props: {
    searchText: {
      type: String
    }
  },
  methods: {
    sendText(e) {
      this.$emit('input', e.target.value);
    }
  }
};
</script>

<style lang="scss" scoped>
@import "../common/style/mixin.scss";

.category-header {
  @include fj;
  width: 100%;
  height: 100px;
  line-height: 100px;
  padding: 0 30px;
  @include boxSizing;
  font-size: 30px;
  color: #656771;
  z-index: 10000;

  &.active {
    background: $red;
  }

  .iconfont-xiangzuo {
    font-size: 40px;
    font-weight: bold;
  }

  .header-search {
    display: flex;
    width: 76%;
    height: 40px;
    line-height: 40px;
    margin: 20px 0;
    padding: 10px 0;
    color: #232326;
    background: #f7f7f7;
    @include borderRadius(40px);

    .iconfont {
      padding: 0 10px 0 40px;
      font-size: 34px;
    }

    .search-title {
      font-size: 24px;
      color: #666;
      background: #f7f7f7;
    }
  }

  .iconfont-gengduo-hengxiang {
    font-size: 45px;
  }

  .search-btn {
    height: 70px;
    margin: 15px 0;
    line-height: 70px;
    padding: 0 10px;
    color: #fff;
    background: $red;
    @include borderRadius(10px);
  }
}
</style>
